
#ifndef _APP_H_
#define _APP_H_


#include "dac6587.h"

#include "tcpip.h"

#define ldp_MAGIC 'K'
#define IOCTL_LDP_INTERLOCK_READ_1		_IOW	(ldp_MAGIC, 1, int)
#define IOCTL_LDP_INTERLOCK_READ_2		_IOW	(ldp_MAGIC, 2, int)

#define IOCTL_LDP_ENABLE_WRITE_1		_IOW	(ldp_MAGIC, 3, int)
#define IOCTL_LDP_ENABLE_WRITE_2		_IOW	(ldp_MAGIC, 4, int)

#define IOCTL_LDP_LM_FAULT_READ_1		_IOW	(ldp_MAGIC, 5, int)
#define IOCTL_LDP_LM_FAULT_READ_2		_IOW	(ldp_MAGIC, 6, int)

#define IOCTL_LDP_TEMP_FAULT_READ_1		_IOW	(ldp_MAGIC, 7, int)
#define IOCTL_LDP_TEMP_FAULT_READ_2		_IOW	(ldp_MAGIC, 8, int)

#define IOCTL_LED_WRITE					_IOW	(ldp_MAGIC, 9, int)



#define COUNTER_MAGIC 'C'
#define IOCTL_COUNTER_READ		_IOW	(COUNTER_MAGIC, 1, int)

#define POWER_MAGIC 'P'
#define IOCTL_CMP_ON	_IOW	(POWER_MAGIC, 1, int)
#define IOCTL_CMP_OFF	_IOW	(POWER_MAGIC, 2, int)
#define IOCTL_PZT_ON	_IOW	(POWER_MAGIC, 3, int)
#define IOCTL_PZT_OFF	_IOW	(POWER_MAGIC, 4, int)

//#define PRINT_OPEN


struct ConterSet					//set counter 
{
	unsigned int		u32EnableCh1;		// set enable		
	unsigned int		u32FreqCh1;			// set frequence - Hz
	unsigned int		u32HihtVoltTimeCh1;	// set hiht voltage time us
	unsigned int		u32MaxFreqCh1;		// set Maxim frequence			
	unsigned int		u32MinFreqCh1;		// set minim frequence	
	unsigned int		u32ChannelCh1;		// set Channel 1
	
	unsigned int		u32EnableCh2;		// set enable
	unsigned int		u32FreqCh2;			// set frequence - Hz
	unsigned int		u32HihtVoltTimeCh2;	// set hiht voltage time us
	unsigned int		u32MaxFreqCh2;		// set Maxim frequence			
	unsigned int		u32MinFreqCh2;		// set minim frequence	
	unsigned int		u32ChannelCh2;		// set Channel 1

	unsigned int		u32Version;			//Version
	
};
struct DacSet
{
	unsigned int		u32VoltageCh1;
	unsigned int		u32MaxVoltageCh1;
	unsigned int		u32MinVoltageCh1;
	
	unsigned int		u32CurrentCh1;
	unsigned int		u32MaxCurrentCh1;
	unsigned int		u32MinCurrentCh1;;
	
	unsigned int		u32VoltageCh2;
	unsigned int		u32MaxVoltageCh2;
	unsigned int		u32MinVoltageCh2;
	
	unsigned int		u32CurrentCh2;	
	unsigned int		u32MaxCurrentCh2;
	unsigned int		u32MinCurrentCh2;;
};

struct Config
{
	struct ConterSet stCounterSet;
	struct DacSet	stDacSet;
	
};
struct SysError
{
	char HeartError;
	char UdpError;
};


#endif




